package cloudInformation.listener;

import cn.idev.excel.context.AnalysisContext;
import cn.idev.excel.read.listener.ReadListener;
import cloudEntity.vo.news.SmartNewsExcelExportVO;

import java.util.ArrayList;
import java.util.List;

/**
 * @program: Smart School
 * @ClassName NewsReadListener
 * @description:
 * @author: 陈智博
 * @create: 2025-05-07 08:11
 * @Version 1.0
 **/
public class NewsReadListener implements ReadListener<SmartNewsExcelExportVO> {

    private List<SmartNewsExcelExportVO> dataList = new ArrayList<>();

    @Override
    public void invoke(SmartNewsExcelExportVO smartNewsExcelExportVO, AnalysisContext analysisContext) {
        dataList.add(smartNewsExcelExportVO);
    }

    @Override
    public void doAfterAllAnalysed(AnalysisContext analysisContext) {
        System.out.println("共读取 " + dataList.size() + " 条数据");
    }
}
